function testAfterSaveCallback(paramsObj)
{
	 refreshComponentDisplay(paramsObj.pageid,'report1',false);
}

function changeUrl()
{
	var datasObj=getEditableReportColValues('base_SysMenuManage','report1',{URL:true,Target:true,TabGroup:true,External:true},{name:'SELECTEDROW',value:true});
	if(isArray(datasObj)&&datasObj.length==1){
		datasObj=datasObj[0];
		var URL=datasObj["URL"].value;
		var Target=datasObj["Target"].value;
		var TabGroup=datasObj["TabGroup"].value;
		if(URL.indexOf("ShowReport.wx")>0 && Target==""){
			Target="navTab";
		}
		if(URL.indexOf("?")>0&& URL.indexOf("PAGEID=")>URL.indexOf("?") && TabGroup==""){
			if(URL.indexOf("&")>URL.indexOf("PAGEID=")){
				TabGroup=URL.substring((URL.indexOf("PAGEID=")+7),URL.indexOf("&"));
			}
			else{
				TabGroup=URL.substr(URL.indexOf("PAGEID=")+7);
			}
		}
		setReportInputBoxValue('base_SysMenuManage','report1',false,{Target:Target,TabGroup:TabGroup},{name:'SELECTEDROW',value:true});
	}
}

function changeParentMenu()
{
	var datasObj=getEditableReportColValues('base_SysMenuManage','report1',{ID:true,parentMenuName:true,MenuID:true},{name:'SELECTEDROW',value:true});
	var allDatasObj=getEditableReportColValues('base_SysMenuManage','report1',{ID:true,MenuName:true,OrderNumber:true,MenuID:true,parentMenuName:true},null);
	var OrderNumber=0,MenuID="",oldParentMenuName="",getOrderNumber=true;
	if(isArray(datasObj)&&datasObj.length==1){
		datasObj=datasObj[0];
		var ParentID=datasObj["parentMenuName"].value;
		var oldParentID=datasObj["parentMenuName"].oldvalue
		var OldMenuID=datasObj["MenuID"].oldvalue;
		for(var i=0;i<allDatasObj.length;i++){
			var dataObj=allDatasObj[i];
			if(dataObj["ID"].value==oldParentID){
				oldParentMenuName=dataObj["MenuName"].value;
			}
			if(dataObj["ID"].value==ParentID){
				MenuID=dataObj["MenuID"].oldvalue;
				if(OldMenuID!="" && MenuID.indexOf(OldMenuID)==0){
					alert("上级菜单不能是自己或者自己的子菜单!");
					setReportInputBoxValue('base_SysMenuManage','report1',false,{parentMenuName:datasObj["parentMenuName"].oldvalue,parentMenuName$label:oldParentMenuName},{name:'SELECTEDROW',value:true});
					return false;
				}
				continue;
			}
			if(dataObj["parentMenuName"].value!=ParentID){
				continue;
			}
			if(dataObj["ID"].value==datasObj["ID"].value){
				getOrderNumber=false;
			}
			if(getOrderNumber){
				if(parseInt(dataObj["OrderNumber"].value,10)>(OrderNumber+1)){
					break;
				}
				else if(!isNaN(parseInt(dataObj["OrderNumber"].value,10))){
					OrderNumber=parseInt(dataObj["OrderNumber"].value,10);
					continue;				
				}
			}
		}
	}
	OrderNumber++;
	var tmpOrderNum=("KK00000"+OrderNumber);
	MenuID=MenuID+tmpOrderNum.substr(tmpOrderNum.length-3);
	setReportInputBoxValue('base_SysMenuManage','report1',false,{OrderNumber:""+OrderNumber,MenuID:MenuID},{name:'SELECTEDROW',value:true});
}